<?php
header("Content-type: text/html; charset=utf-8");
require("inc/common.inc.php");
$nowdate=date("Y-m-d");
$adate=date('Y-m-d',strtotime("$nowdate -7 day"));
$id=intval($id);
if ($id>0){
	$fidinfo=$db->getinfo("select * from mx_vpp_articleclass where fid='$id' limit 1");
	if (!is_array($fidinfo)){
		echo "|@#page#@|";
		exit();
	}
}
$fupid=$db->get_f_aid($fidinfo["fid"]);
if ($fupid!=23){
	echo "|@#page#@|";
	exit();
}

$pagesize=intval($pagesize);
if ($pagesize==0){$pagesize=2;}

	if(empty($pageindex)){$pageindex=1;}
    $str=" and yz='1' ";
    $s="";
	if ($id>0){
		$idstr=$id.$db->get_aid($id,"mx_vpp_articleclass");
		$str.=" and fid in ($idstr) ";
		$s.="id=$id&";
	}
	

	$table=" mx_vpp_article ";
	$order=" order by  isgood desc,istop desc, orderid, posttime desc, aid desc";
	$column=" * ";
	$biaoid="aid";

	$c=$db->listcount($table,$str);

	$list=$db->list1($pageindex,$pagesize,$table,$column,$str,$order,$biaoid);

	if(!is_array($list) or $c==0 and $pageindex==1){
	  echo "|@#page#@|<center>暂无信息</center>";
	  exit();
	}
	else{
		$nowhavenum=($pagesize*($pageindex-1))+count($list);
		if ($nowhavenum<$c){echo "1";}
		echo "|@#page#@|";
		for($i=0;$i<count($list);$i++){
	?>
	<h1><?php echo $list[$i]["title"]?></h1>
	<p><?php echo stripslashes($list[$i]["content"]);?></p>
	<?php
		}
	}
	?>